package com.pet.system;

import com.pet.system.util.IpUtils;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
@MapperScan("com.pet.system.mapper")
@Slf4j
public class Application {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);

        Environment environment = context.getBean(Environment.class);
        //项目端口
        String port = environment.getProperty("server.port");
        //项目路径
        String path = environment.getProperty("server.servlet.context-path");
        log.info("  " +
                "  \n\t" +
                "项目启动成功！\n\t" +
                "接口文档:http://{}:{}{}/doc.html" +
                "", IpUtils.getHostIp(), port, path);
    }

}
